{extend name="base/container" /}
{block name="main"}
<label  class="layui-label">提示：若执行重置密码操作，密码将被重置为与用户名相同</label>
<table class="layui-table" id="workerTable" lay-filter="workerTb">
    <thead>
        <tr>
            <th lay-data="{field:'xh', type:'numbers'}">序号</th>
            <th lay-data="{field:'account'}">用户名</th>
            <th lay-data="{field:'unik'}">姓名</th>
            <th lay-data="{field:'sex', templet:function(d){return layui.xls_format.format_worker_sex(d.sex);}}">性别</th>
            <th lay-data="{field:'urole', templet:function(d){return layui.xls_format.format_worker_role(d.urole);}}">职位</th>
            <th lay-data="{field:'identity'}">身份证号</th>
            <th lay-data="{field:'birthday'}">生日</th>
            <th lay-data="{field:'pstatus', templet:function(d){return layui.xls_format.format_worker_pstatus(d.pstatus);}}">密码状态</th>
            <th lay-data="{field:'op', toolbar:'#rowbar', width:200}">操作</th>
        </tr> 
    </thead>
</table>
<script type="text/html" id="rowbar">
    {{# if(d.status == "0"){ }}
    <button class="btn-able layui-btn layui-btn-danger layui-btn-xs layui-btn-disabled" disabled="disabled" data-type="enable" lay-event="worker_able">禁用</button>
    <button class="btn-able layui-btn layui-btn-normal layui-btn-xs" data-type="disable" lay-event="worker_able">激活</button>
    {{#  } else { }}
    <button class="btn-able layui-btn layui-btn-danger layui-btn-xs" data-type="enable" lay-event="worker_able">禁用</button>
    <button class="btn-able layui-btn layui-btn-normal layui-btn-xs layui-btn-disabled" disabled="disabled" data-type="disable" lay-event="worker_able">激活</button>
    {{#  } }}
    <button class="reset-pass layui-btn layui-btn-normal layui-btn-xs" data-type="repass" lay-event="worker_repass">重置密码</button>
</script>
<script type="text/javascript">
    layui.use(["table"],function(){
        var table = layui.table;
        //转换静态表格,table.init(filter, options)
        table.init('workerTb', {
            url:'{$url}',
            page:true,
            //count: count,
            limit: 5, //注意：请务必确保 limit 参数（默认：10）是与你服务端限定的数据条数一致
            limits: [5,10,20],
            id: 'workerReload' // 要重载的表格ID
        }); 
    })
</script>
{/block}

{block name="footer"}
{__block__}
{/block}